package yuhuibear.poat.version;

/**
 * 这里是一个简要的版本说明。 直接运行 java -jar poat.jar 便可查看。
 * 
 * @author yuhuibear
 */
public class Version {

	private static final VersionBuffer version = new VersionBuffer();
	static {
		version.appendLine("POAT , Persisst Object Access Tool, author yuhui. ");
		version.appendLine("version history:");
		version.appendVersion("0.04 2008-12-24", "fixed: while adding object, no attribute can be omitted .", "added: annotation: SkipOnNull.");
		version.appendVersion("0.05 2008-12-31", "added: convert BigDecimal and BigInteger from database.");
		version.appendVersion("0.06 2009-01-15", "fixed: convert attributes name 0f tables to bean name.");
		version.appendVersion("0.07 2009-01-29", "added: map Object to data base entity by annotations.", "fixed: alertated cache system to uiversal system.");
		version.appendVersion("0.08 2009-02-03", "updated: annotation: SkipOnNull, to annotation AutoGenerateValue.auto value will be set after inserting.", "added: auto insert or delete column.", "added: map view to Object.");
		version.appendVersion("0.09 2009-02-13", "fixed: can list by order.", "added: when need define of relations cannot be found, report Exception.");
		version.appendVersion("0.091 2009-02-17", "added: two of new get methods to convient get single Object from database.");
		version.appendVersion("0.091 2009-02-23", "added: if AutoGenerateValue.sqlTOGet is null, report error.");
		version.appendVersion("0.092 2009-02-25", "fixed: orders of parameters while condition updating.");
		version.appendVersion("0.093 2009-03-04", "fixed: failed on transaction isolating.");
		version.appendVersion("0.094 2009-03-21", "fixed: unsuitable closing of pipe under mutil-thread.", "deprecated: update(T oldone, T newone).");
		version.appendVersion("0.095 2009-03-31", "fixed: null exception of pipe under mutil-thread.");
		version.appendVersion("0.096 2009-04-1", "fixed: Exception of stream closed.", "added: fail hints when create table fail.");
		version.appendVersion("0.097 2009-04-10", "added: new Annotation @Macro to create functions, triggers and so on.");
		version.appendVersion("0.098 2009-05-09", "fixed: declear inner class.");
		version.appendVersion("0.099 2009-05-14", "fixed: create statements order bug.");
		version.appendVersion("0.1 2009-05-27", "fixed: check view consistence bug.");
		version.appendVersion("0.11 2009-06-16", "added: update(T obj) method to replace update(T old, T newone).");
		version.appendVersion("0.12 2009-07-09", "added: Big Number convert to basic class.");
		version.appendVersion("0.12a 2009-07-09", "fixed: upate(Object) date issue.");
		version.appendVersion("0.12b 2009-07-18", "fixed: some log message.");
		version.appendVersion("0.12c 2009-07-24", "fixed: Macro analyse error.");
		version.appendVersion("0.13a 2009-07-29", "fixed: cross table update.", "added: annotation GlobalIdentifyKey");
		version.appendVersion("0.14 2009-11-23", "improved performance: entity mapper.");
		version.appendVersion("0.15 2009-11-25", "fixed: parse entity from view define.", "modified: log system.");
		version.appendVersion("0.16 2009-11-25", "fixed: update auto rollback.");
		version.appendVersion("0.17 2009-12-19", "fixed: delete object fails when use delete(Object).");
		version.appendVersion("0.18 2009-12-20", "fixed: select with distinct.");
		version.appendVersion("0.19 2009-12-31", "added: skill null value of primarykey when insert event without Annotation of AutoValue");
		version.appendVersion("0.20 2010-1-1", "added: having group support.");
		version.appendVersion("0.21 2010-1-8", "added: array input and output support, just support: Long[], Integer[], Double[] with jdbc4.", "add: user data source, schema data source, direct data source for independent operations of db.");
		version.appendVersion("0.22 2011-5-11", "fixed: @Field name has blank will crash Object construction.");
	}

	public static void main(String[] args) throws Exception {
		if (args.length < 2)
			System.out.println(version);
	}
}

class VersionBuffer {

	private StringBuffer buf = new StringBuffer();

	public void appendVersion(String version, String... inf) {
		buf.append("Version : " + version);
		buf.append("\n");
		for (String s : inf)
			buf.append("\t\t" + s + "\n");
		buf.append("\n");
	}

	public void appendLine(String str) {
		buf.append(str + "\n");
	}

	public String toString() {
		return buf.toString();
	}
}
